package org.easy.controller;

import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboReference;
import org.easy.platform.system.api.ISystemApi;
import org.easy.platform.system.feign.SystemApiFeign;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类说明
 *
 * @author YanMing
 * @date 2024/4/29
 */
@RestController
@RequestMapping
public class DiscoverController {
//此处就是基于Feign的注解，其就是一个接口，之后贴代码。宝子们只需要知道用这个接口就可以调用远程服务就行了
    @Resource
    SystemApiFeign systemApiFeign;
    @DubboReference
    ISystemApi systemApiDubbo;


    @GetMapping("/feign")
    public String feign(@RequestParam(value = "content", required = false) String content){
        //执行远程服务调用
        return systemApiFeign.hello("feign");
    }

    @GetMapping("/dubbo")
    public String dubbo(@RequestParam(value = "content", required = false) String content){
        //执行远程服务调用
        return systemApiDubbo.hello();
    }
}
